<template>
  <span>{{ innerRowIndex }}</span>
</template>
<script>
import {createProps} from '@/utils';

export default {
  name: 'RowIndex',
  props: {
    fieldConfig: createProps(Object),
    value: {
      type: [Number, String],
      default: undefined,
    },
    title: createProps(String),
    auth: createProps(String),
    rowIndex: {
      type: [Number, String],
      default: undefined,
    }
  },
  computed: {
    innerRowIndex() {
      this.$emit('update:value', this.rowIndex + '');
      if (this.rowIndex) return this.rowIndex + 1;
      return 1;
    },
  }
};
</script>